<php>
    /*这里只是一个模板函数库演示，详细请查看http://www.thinkcmf.com/document/article/id/398.html*/
    /*可以加多个方法哟！*/
    function _sp_helloworld(){
        echo "hello ThinkCMF!";
    }

    function _sp_helloworld2(){
        echo "hello ThinkCMF2!";
    }


    function _sp_helloworld3(){
        echo "hello ThinkCMF3!";
    }
    function _user_list($uid){
        $teaname= M('Users')->where(array('id'=>$uid))->getField('id,user_nicename,avatar,signature',true);
        $userlist['uname'] = $teaname[$uid]['user_nicename'];
        $userlist['avatar'] = $teaname[$uid]['avatar'];
        $userlist['signature']= $teaname[$uid]['signature'];
        return $userlist;
    }
    function _article_list($uid){
    $join = '__POSTS__ as posts on term_relationships.object_id = posts.id';
    $term_relationships_model= M("TermRelationships");
        $list = $term_relationships_model
                ->alias("term_relationships")
                ->join($join)
                ->where(array('posts.uid'=>$uid))
                ->select();
        return $list;
    }
</php>